<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<section class="scrollable padder">
    <!-- 导航条 -->
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a href="javascript:;"><i class="fa fa-home"></i> 首页</a></li>
        <li><a href="javascript:;" class="active" ng-bind="title"></a></li>
    </ul>

    <!-- 加载提醒 -->
    <div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

    <section class="panel panel-default">

        <div class="row text-sm wrapper">
            <div class="panel-heading clearfix">
                <a ui-sref="main.sys.role.create" class="btn btn-info pull-right">
                    <i class="icon-user-follow m-r-sm text-md"></i>添加角色</a>
                <div class="col-md-4">
                    <form ng-submit="search()" class="ng-pristine ng-valid">
                        <div class="input-group search-box">
                            <input type="text" class="form-control" ng-model="param.keyword" placeholder="角色名称">
                            <i ng-show="param.keyword" ng-click="clearSearch()" class="fa fa-times-circle text-muted search-clear"></i>
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                            </span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light text-sm">
                <thead>
                <tr>
                    <th width="20"><input type="checkbox"></th>
                    <th>角色名称</th>
                    <th>角色类型</th>
                    <th>权限</th>
                    <th>部门</th>
                    <th>状态</th>
                    <th width="30"></th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in pageInfo.records">
                    <td class="v-middle"><input type="checkbox" name="post[]" value="2"></td>
                    <td class="v-middle">{{item.roleName}}</td>
                    <td class="v-middle">{{item.roleType}}</td>
                    <td class="v-middle text-left permit-list col-lg-6"  ng-bind-html="item.permission | label:';' |trustHtml"></td>
                    <td class="v-middle">{{item.dept}}</td>
                    <td class="v-middle">
                        <span ng-hide="item.enable==1" class="text-danger">禁用</span>
                        <span ng-show="item.enable==1" class="text-success">启用</span>
                    </td>
                    <td class="v-middle">
                        <a ui-sref="main.sys.role.update({id: item.id})" class="btn btn-sm btn-default">
                            <i class="fa fa-edit m-r-xs text-sm"></i>编辑</a>
                        <button type="button" ng-show="item.enable==1"  ng-click="disableItem(item.id,0)" class="btn btn-sm btn-default m-l-xs">
                            <i class="fa fa-ban m-r-xs text-sm"></i>禁用</button>
                        <button type="button" ng-hide="item.enable==1"  ng-click="disableItem(item.id,1)" class="btn btn-sm btn-default m-l-xs">
                            <i class="fa fa-check m-r-xs text-sm"></i>启用</button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <!-- 底部分页 -->
        <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>

    </section>
</section>